import request from '../utils/request'


const requestUrl = '/roomReserveInfo'

export function fecthList(params){
   return request({
        url: requestUrl+'/getRoomReserveInfoList',
        method: 'get',
        params: params
})
}
export function getById(id){
    return request({
         url: requestUrl+'/getRoomReserveInfoById',
         method: 'get',
         params: { id }
    })
 }
 export function getOrderInfoById(id){
      return request({
           url: "/orderInfo/getOrderInfoById",
           method: 'get',
           params: { id }
      })
 }

 export function getRoomInfoByRoomId(id){
     return request({
          url: "/roomInfo/getRoomInfoByRoomId",
          method: 'get',
          params: { id }
     })
}

export function add(data){
    return request({
         url: '/dict/save',
         method: 'post',
         data
    })
 }
 export function update(data){
    return request({
         url: '/',
         method: 'post',
         data
    })
 }
 export function deleteOne(data){
    return request({
         url: requestUrl+'/deleteRoomReserveInfo',
         method: 'post',
         data: [data]
    })
 }
 export function deleteByIds(data){
    return request({
         url: requestUrl+'/deleteRoomReserveInfo',
         method: 'post',
         data
    })
 }
 export function getRoomType(){
      return request({
           url: '/roomType/queryAllRoomType',
           method: 'post'
      })
 }
 export function getRooms(roomType){
      return request({
          url: '/roomInfo/getRoomInfoByRoomType',
           method: 'get',
           params: { roomType }
      })
 }

export function addReserve(data){
     return request({
          url: '/roomReserveInfo/addRoomReserveInfo',
          method: 'post',
          data
     })
}
export function checkIn(data){
     return request({
          url: '/checkinInfo/checkIn',
          method: 'post',
          data
     })
}
export function cancelReserve(data) {
    return request({
        url: requestUrl + '/cancelReserve',
        method: 'post',
        data
    })
}

export function getRoomId(data) {
    return request({
        url: '/roomInfo/getRoomId',
        method: 'get',
        data
    })
}